<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c" %>   
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="lib/amazeui/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="lib/amazeui/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <!-- cssjs -->
    <jsp:include page="/WEB-INF/page/bgo_layout/cssjs.jsp" />

</head>

<body data-type="widgets">
    <script src="lib/amazeui/assets/js/theme.js"></script>
    <div class="am-g tpl-g">
         <!-- 头部 -->
        <jsp:include page="/WEB-INF/page/bgo_layout/head.jsp" />
        <!-- 侧边导航栏 -->
         <jsp:include page="/WEB-INF/page/bgo_layout/left.jsp" />

        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">
            <div class="row-content am-cf">


                <div class="row">

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">用户管理</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>  
                            <div class="widget-body am-fr">

                                <form action="userAction_saveOrUpdateOpt_user.hp" method="post"   class="am-form tpl-form-line-form">
                                    <input id="img_url_hidde" name="img_url" type="hidden" value="${user.img_url }"/>
                                    <c:if test="${user.id!=null}">
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">编号 ：</label>
                                        <div class="am-u-sm-9">
                                            <input value="${user.id}" readonly="readonly" name="id" type="text" class="tpl-form-input" id="user-name" placeholder="请输入编号">
                                            
                                        </div>
                                    </div>
                                    </c:if>
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">封面图：</label>
                                        <div class="am-u-sm-9">
                                        <c:if test="${user.id==null}">
                                        <img style="width: 121px;height: 121px" id="img_url" src="img/headimg.jpg" /> <button type="button"  id="kdUploadSelect"  class="am-btn am-btn-default am-btn-success">上传封面</button>
                                        </c:if> 
                                        <c:if test="${user.id!=null}">
                                          <c:if test="${user.img_url=='' || user.img_url==null}">
                                            <img style="width: 121px;height: 121px" id="img_url" src="img/headimg.jpg" /> <button type="button"  id="kdUploadSelect"  class="am-btn am-btn-default am-btn-success">上传封面</button>
                                          </c:if>
                                          
                                          <c:if test="${user.img_url!=null &&  user.img_url!=''}">
                                            <img style="width: 121px;height: 121px" id="img_url" src="${user.img_url}" /> <button type="button"  id="kdUploadSelect"  class="am-btn am-btn-default am-btn-success">上传封面</button>
                                          </c:if>                                      
                                        </c:if>  
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">名称 ：</label>
                                        <div class="am-u-sm-9">
                                            <input value="${user.name}" name="name"  type="text" class="tpl-form-input" id="user-name" placeholder="请输入名称">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">密码 ：</label>
                                        <div class="am-u-sm-9">
                                            <input value="${user.pwd}" name="pwd" type="text" class="tpl-form-input" id="user-name" placeholder="请输入密码 ">
                                        </div>
                                    </div>
                                    <c:if test="${userinfo.jurisdiction==1 }">
                                   <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">权限 ：</label>
                                       
                                        <select name="jurisdiction" data-am-selected="{searchBox: 1}">
                                         <option value="2">用户</option>
                                         <option value="1">管理员</option>
									</select>
											
                                    </div>
                                    </c:if>
                                    

                                    <div class="am-form-group">
                                        <div class="am-u-sm-9 am-u-sm-push-3">
                                            <input type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success " value="提交" />
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

     

 


            </div>
        </div>
    </div>
    </div>
  <jsp:include page="/WEB-INF/page/bgo_layout/foot.jsp" />

</body>
<script type="text/javascript">
$.hpUpload("uploadAction_uploadFileDisk.hp", {
				"path" : "/image"
			}, function(json) {
				console.log(json);
				$("#img_url").attr('src', imgPath + json.imgPath);
				$("#img_url_hidde").attr('value', imgPath + json.imgPath);
			});
</script>
</html>